package cn.edu.hznu.ocw.actions;

import java.util.List;
import java.util.Map;

import org.apache.struts2.interceptor.RequestAware;

import cn.edu.hznu.ocw.dao.CourseTypeDAO;
import cn.edu.hznu.ocw.domain.CourseType;

import com.opensymphony.xwork2.ActionSupport;

public class CourseTypeManage extends ActionSupport implements RequestAware {
	private static final long serialVersionUID = -8225278188622907861L;
	private Map request = null;
	private String optype = null;
	
	public String getOptype() {
		return optype;
	}

	public void setOptype(String optype) {
		this.optype = optype;
	}

	@Override
	public String execute() throws Exception {
		if(optype.equals("check")){
			CourseTypeDAO ctd = new CourseTypeDAO();
			List<CourseType> list = ctd.getCourseTypes();
			request.put("menulist", list);
			return "check";
		} else if(optype.equals("add1")){
			
		} else if(optype.equals("add2")){
			
		}
		CourseTypeDAO ctd = new CourseTypeDAO();
		List<CourseType> list = ctd.getCourseTypes();
		request.put("menulist", list);
		return super.execute();
	}

	@Override
	public void setRequest(Map request) {
		this.request = request;
	}

}
